package com.mht.book.entity.book;

/**
 * @author wangfusheng
 * @version 1.0.0
 * @ClassName BookList.java
 * @Description TODO
 * @createTime 2022/12/311:28
 */
public class BookList {
    //定义一个长度为10 的Book对象数据
    private Book[] books = new Book[10];
    //定义的书架上书的数量
    private int usedSize;


    public Book[] getBooks() {
        return books;
    }

    public void setBooks(Book[] books) {
        this.books = books;
    }

//    public void setBooks(int index,Book book) {
//        books[index] = book;
//    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public BookList() {
        books[0] = new Book("西游记","吴承恩",40,"小说",true);
        books[1] = new Book("水浒传","施耐庵",45,"小说",false);
        books[2] = new Book("笑傲江湖","金庸",50,"小说",false);
        books[3] = new Book("数据结构","张三",68,"数学",false);
        this.usedSize = 4;
    }

    public Book getBook(int index){
        return books[index];
    }
}
